import {getDictItemstList} from '@/api/dict'
export const type1 = {
  data(){
    return {
      navList:[],
      navList2:[],
    }
  },
  onLoad(){

  },
  mounted(){
  },
  methods:{
    getNextList(type='a'){
      const list = [
        {
          cate_name: '党建引领',moveType:17,type:'17',
          icon:'../../static/home-ico/1.png',
          isShow:true
        },

        {
          cate_name: '暖“新”行动',moveType:21,type:'21',
          icon:'../../static/home-ico/2.png',
          isShow:true
        },
        {
          cate_name: '共迎亚运',moveType:22,type:'22',
          icon:'../../static/home-ico/3.png',
          isShow:true
        },
        {
          cate_name: '抢福利',moveType:0,type:'0',
          icon:'../../static/home-ico/4.png',
          isShow:true
        },
        {
          cate_name: '做公益',moveType:11,type:11,
          icon:'../../static/home-ico/5.png',
          isShow:true
        },
        {
          cate_name: '交友',moveType:12,type:'12',
          icon:'../../static/home-ico/6.png',
          isShow:true
        },
        {
          cate_name: '文艺范',moveType:'13',type:'13',
          icon:'../../static/home-ico/7.png',
          isShow:true
        },
        {
          cate_name: '充充电',moveType:15,type:'15',
          icon:'../../static/home-ico/8.png',
          isShow:true
        },
        {
          cate_name: '动起来',moveType:14,type:'14',
          icon:'../../static/home-ico/8.png',
          isShow:false
        },

        {
          cate_name: '立功竞赛',moveType:18,type:'18',
          icon:'../../static/home-ico/8.png',
          isShow:false
        },
        {
          cate_name: '特定活动',moveType:16,type:'16',
          icon:'../../static/home-ico/8.png',
          isShow:false
        },
        { cate_name: '历史活动', moveType: 99,type:'99',isShow:false }
      ]
      if(type==='a'){
        this.navList = list
      } else if(type==='b'){
        this.navList = list
      }


    },
    //活动分类
    getDictItemstList(type=1){
      const plist1 = []
      const plist2 = []
      getDictItemstList({dictCode:'move_Type2'}).then(res=>{
        const  {code, result} = res
        if(code===0 || code === 200){
          result.map(item=>{
            const {title,
              value} = item
            plist1.push({
              cate_name: title,moveType:value,type:value,
            })
          })
          plist1.push({
            cate_name: '抢福利', moveType: 0 ,type:'0',isShow:true
          },  { cate_name: '历史活动', moveType: 99,type:'99',isShow:true })
          this.navList = plist1

          const index = this.navList.findIndex(item=>{
            if(item.type==='19'){
              return false
            }
            return item.type===this.isType
          })
          if(this.actives===0){
            this.active = 0
          }else {
            this.active = index>0?index-1:index
          }


        }
      }).catch(e=>{
        console.log(e)
      })
    },
  },
}
